Field of the Invention
Aspects of the present invention relate generally to a method and a device for merging graphic layers, and more particularly, to a method and a device for merging graphic layers on an Android platform.
Description of the Related Art
In the field of mobile devices, multimedia video playback functions have become an essential requirement.
In a multimedia video playback system applied in an Android platform, a hardware composer (Hwcomposer) sequentially processes graphic layers transmitted from a SurfaceFlinger. A traditional implementation is for the Hwcomposer to process the graphic layers sequentially in the Z-axis direction, and then to tag each graphic layer according to a priority of overlay, bit-block transfer (blit) and fallback. However, a disadvantage of this implementation is that the Hwcomposer has to processes the graphic layers according to the order in which the graphic layers are transmitted from the SurfaceFlinger.
When the number of source graphic layers is greater than the number of streams supported by the display interface units (DIU), the source graphic layers need to be merged. To ensure that the overlay order is correct, only adjacent graphic layers can be merged. A traditional method may be for the graphic layers to be sequentially merged from the highest graphic layer to the lower graphic layer in the Z-axis direction, or the graphic layers are sequentially merged from the lowest graphic layer to the higher graphic layer in the Z-axis direction, until the number of graphic layers matches the number of streams. The disadvantage of this method is that it is reliant on the Z-axis order of the graphic layers; therefore, the method may not be providing the optimal performance.
In addition, the traditional Hwcomposer may use a large number of streams to achieve optimal performance. However, power consumption of the DIU is positively correlated to the number of streams. This causes high power consumption.
As the foregoing illustrates, a new method and a device for displaying and merging graphic layers in the Android platform may be desirable.